<?php

/**
 * Yahoo! YUIのCSS Reset用px変換クラス
 *
 * 主にSmartyのテンプレート内で使います。
 * 参考URL: http://yuiblog.com/assets/pdf/cheatsheets/css.pdf
 */
if(!class_exists('cYUI_CSS')){
    class cYUI_CSS{
        function cYUI_CSS(){
        }

        function font_size($s){
            $s = str_replace("px","",$s);
            $s = ($s<10) ? "1" : ($s>26) ? "30" : $s;
            $aChart = array( "1"=>"50%", "10"=>"77%", "11"=>"85%", "12"=>"93%", "13"=>"100%", "14"=>"108%", "15"=>"116%", "16"=>"123.1%", "17"=>"131%", "18"=>"138%", "19"=>"146.5%", "20"=>"153.9%", "21"=>"161.6%", "22"=>"167%", "23"=>"174%", "24"=>"182%", "25"=>"189%", "26"=>"197%", "30"=>"200%" );
            return $aChart[$s];
        }
        
        function width($s){
            $s = str_replace("px","",$s);
            return round($s/13,2) . "em";

        }

        function width_IE($s){
            $s = str_replace("px","",$s);
            return round($s/13.3333,2) . "em";

        }
    }
}

?>